package com.backend.mapper.blog;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pojo.entity.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    Integer saveContent(@Param("content") String content, @Param("id") Long id);

    Long addArticle(Article article);

    Integer removeArticle(@Param("id") Long id);

    Integer removeContent(@Param("id") Long id);

    Integer updateArticle(Article article);

    Integer updateContent(@Param("id") Long id, @Param("content") String content);

    String getContent(@Param("id") Long id);

    List<Long> getAllArticleIdByUserId(@Param("id") Long id);

    Integer addPoll(@Param("now") LocalDateTime now, @Param("id") Long id, @Param("userId") Long userId);

    Integer removePoll(@Param("id") Long id, @Param("userId") Long userId);
}
